<div id="split_table">
    <div id="mess"><?php if (isset($mess)) echo $mess; ?></div>
    <div id="user_table">
        <div class="t_head">    
            <span id="nadpis">Moje eventy:</span>
        </div>
        <?php
        echo "<table id='events' cellspacing='1' cellpadding='4'>";
        if ($events == false)
            echo "<tr class='row1'><td><b>Nenašli sa žiadne eventy</b></td><tr>";
        else {
            echo "<tr id='hlavicka'> <td>#</td> <td>názov eventu</td> <td>typ eventu</td> <td>termín eventu</td> <td>od</td> 
          <td>do</td> <td>miestnosť</td> <td>editovať</td> <td>zmazať</td> </tr>";
            $i = 0;
            $js = "return confirm('Označený event bude natrvalo vymazaný!')";
            foreach ($events as $event) {
                $i++;
                $day = getDay($event["event_day"]);
                echo "<tr class = 'row" . ($i % 2) . "'>";
                echo "<td>" . $i . "</td>";
                echo "<td>" . $event["description"] . "</td>";
                echo "<td>" . getEventType($event["event_type"]) . "</td>";
                echo "<td>" . $day . "</td>";
                echo "<td>" . getStringTimeFromMinutes($event["start_time"]) . "</td>";
                echo "<td>" . getStringTimeFromMinutes($event["end_time"]) . "</td>";
                echo "<td>" . getRoomName($event["room_id"]) . "</td>";
                echo '<td><a href="' . base_url() . "user/editevent/" . $event["id"] . '" title="edituj event"  >edituj</a></td>';
                echo '<td><a href="' . base_url() . "user/deleteevent/" . $event["id"] . '" title="zmazat event" onclick="' . $js . '" >zmazať</a></td>';
                echo "</tr>";
            }
        }
        echo "</table>";
        ?>
    </div>


</div>